package com.xiyucode.yuerclientsdk.psvm;

import cn.hutool.http.HttpUtil;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.net.URLEncoder;

public class GetPython {

    public static void main(String[] args) {

        String name = "马希语";
        String result = getNameByGetTOPython(name);
        System.out.println(result);

    }

    public static String getNameByGetTOPython(String name) {
        //可以单独传入http参数，这样参数会自动做URL编码，拼接在URL中
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("name", name);
        // CharsetUtil.CHARSET_UTF_8
        String result = HttpUtil.get("http://localhost:8333/api/getUrlInfo", paramMap);
        return result;
    }

}
